﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TribesPSO
{
    /// <summary>
    /// A multithreaded spearch space implementation that uses HyperSphereParticles
    /// </summary>
    public sealed class MultithreadedHypersphereSearchSpace : MultithreadedSearchSpace<HypersphereParticle>
    {
        /// <summary>
        /// Creates a new Multi-threaded hypersphere search space to solve the specified objective function
        /// </summary>
        /// <param name="objectiveFunction">The IObjectiveFunction to solve</param>
        public MultithreadedHypersphereSearchSpace(IObjectiveFunction objectiveFunction)
            : base(objectiveFunction) { }

        /// <summary>
        /// Creates a new GaussianParticle at the specified location and the SearchSpaces own IObjectiveFunction
        /// </summary>
        /// <param name="position">The initial location of the new particle</param>
        /// <returns>A new GaussianParticle</returns>
        protected override HypersphereParticle GenerateParticleAtPosition(EuclidianVector position)
        {
            return new HypersphereParticle(this.GoodnessFunction, position, new HyperspaceRandom());
        }
    }
}
